export default function (arr) {
  const date = new Date();
  const hour = date.getHours();
  const copyArr = Object.assign([], arr);
  const index = arr.findIndex((item) => {
    const prevHour = item.text.split(" - ")[0].slice(0, 2);
    const nextHour = item.text.split(" - ")[1].slice(0, 2);
    return prevHour <= hour && hour < nextHour;
  });
  if (index !== -1 && index !== copyArr.length - 1) {
    arr.unshift({ text: "2小时内上门", status: true });
    arr = arr.map((item, i) => {
      if (i >= index + 2) {
        item.status = true;
      }
      return item;
    });
    arr[index + 2].status = 1;
  }
  return arr;
}
